from rest_framework.serializers import ModelSerializer

from .models import StudentInfo, CourseItem


class StudentInfoSerializer(ModelSerializer):
    class Meta:
        model = StudentInfo
        fields = "__all__"
        extra_kwargs = {
            'student_password': {'write_only': True}  # 设置该字段仅用于写入，不包含在响应中
        }


class CourseItemSerializer(ModelSerializer):
    class Meta:
        model = CourseItem
        fields = "__all__"
